﻿<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
		<meta name="apple-mobile-web-app-title" content="思路广惠">
		<title>会员升级</title>

		<meta content="telephone=no" name="format-detection" />

		<link rel="stylesheet" type="text/css" href="../../src/css/base.css?1.0" />
	</head>

	<body class="body-bg">
		<header class="header">
			<a href="javascript: history.go(-1)" class="head-le"><i class="iconfont icon-fanhui i2m"></i></a>
			<h1 class="header-txt">会员升级</h1>
		</header>
		<section> 
			<div class="vip-par" id="vipPar">

			</div>
			 
			<h1 class="uplist-h1">申请列表</h1>
			<ul  id="uplist">
				
				 
			</ul> 
		</section>
		<script type="text/html" id="uplists"> 
			{{# if(d.PageData.length == 0){ }}
			<p style="text-align:center; padding: 20px 0;">没有申请记录</p>
			{{# } }} 
			{{# for(var i = 0; i < d.PageData.length; i++){ }} <div class="apply-item" data-type="{{d.PageData[i].LevelUp_ID}}">
				<li class="uplist-li">
					<p class="uplist-p">申请时间：{{d.PageData[i].LevelUp_ApplyTime}}</p>
					<div class="uplist-d flexs">
						<p>
							原级别：{{d.PageData[i].LevelName_Old}}
						</p>
						<p>
							付款： <span class="huef36">￥{{d.PageData[i].LevelUp_PayMoney }}</span> 
						</p> 
						<p>
							新级别：{{d.PageData[i].LevelName_New}}
						</p>
						<p>
							贷款： <span class="huef36">￥{{d.PageData[i].LevelUp_LoanMoney}}</span> 
						</p>
					</div> 
					<div class="flexs-bw flexs-al uplist-b">
						<p>申请状态：<span class="uplist-span">  {{# if(d.PageData[i].LevelUp_Mark == 0){ }}
                                        待审核 
                                    {{# } }}
                                    {{# if(d.PageData[i].LevelUp_Mark == 1){ }}
                                        审核通过 
                                    {{# } }}
                                    {{# if(d.PageData[i].LevelUp_Mark == 2){ }}
                                        已驳回 
                                    {{# } }}
                                    {{# if(d.PageData[i].LevelUp_Mark == 9){ }}
                                        已取消
                                    {{# } }}</span> </p>
                                    {{# if(d.PageData[i].LevelUp_Mark !== 1){ }}
						<button class="uplist-btn cancel">取消申请</button>
						{{# } }}
					</div>
				</li>
				{{# } }}
		</script>
		<script src="http://apps.bdimg.com/libs/laytpl.js/1.1/laytpl.js"></script>
		<script src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
		<script src="//cdn.bootcss.com/layer/3.0.1/mobile/layer.js"></script>
		<script src="../../src/js/all.js" type="text/javascript" charset="utf-8"></script>
		<script>
			$(function() {

				// 获取会员等级图片
				$.get(urls + "/BaseLevel/GetLevel", {
					AppID: AppID,
					Token: Token
				}, function(res) {
					if(res.Return_ID == 0) {
						var htmls = "",
							res = res.Return_Data.PageData;
						for(var i = 0; i < 4; i++) { //res.length
							htmls += '<a href="memberupapply.html?levelID=' + res[i].Level_ID + '"><img src= "' + imgurlbig + res[i].UpdateImage_Url + '" /></a>'
						}
						$("#vipPar").html(htmls);
					}
				});

				silks.temp(["#uplists", "#uplist"], "/WorkMembersLevelUp/GetLevelUpByMembersID", {
					MembersID: MembersID,
					OrderNumber: "",
					StartDate: "",
					EndDate: "",
					PageIndex: 0
				}, function() {
					console.log(this)
					
						//点击取消
						$(".cancel").click(function() {
						layer.open({
							content: '取消申请不可返回，确定取消申请',
							shadeClose: false,
							btn: ['确定', '取消'],
							yes: function(index) {
								var LevelUpID = $(this).closest(".apply-item").attr("data-type");
								$.get(urls + "/WorkMembersLevelUp/LevelUpCancel", {
									LevelUpID: LevelUpID,
									MembersID: MembersID,
									AppID: AppID,
									Token: Token
								}, function(res) {
									layers(res.Return_Mess)
								})
							},
							no: function(index, layero) {
	
							}
						});
	
					})
					
					
				})

				

			});
		</script>
	</body>

</html>